<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <script>
    		var contentPage = {
        			submitForm:function(){
        				if(!$('#myForm').form('validate')){
        					$.messager.alert('提示','信息不完整');
        					return ;
    					}else{
    						$.post("provider/addProvider",$("#myForm").serialize(),function(data){
    	    					if(data.state == 200){
    	    						$.messager.alert('提示','添加成功');
    	    						$("#myForm").form("reset");
    	    						$("#d").window("close");
    	    						$("#ta").datagrid("reload");
    	    					}else{
    	    						$.messager.alert('提示','添加失败');
    	    					}
    	    				});
    						
    					}
        			},
        			clearForm:function(){
        				$("#myForm").form("load",{
        	    			providerid:"",
        	    			providername:"",
        	    			providerlegal:"",
        	    			providertel:""
        				}) 
        			}
        	};

    </script>
<form id="myForm">
		<table align="center" width="60%" >
			<tr >
				<td>供应商名称</td>
				<td>
					<input class="easyui-textbox" type="text" name="providername" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td>供应商负责人</td>
				<td>
					<input class="easyui-textbox" type="text" name="providerlegal" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td>供应商电话 </td>
				<td>
					<input class="easyui-textbox" type="text" name="providertel" data-options="required:true">
					<input class="easyui-textbox" type="hidden" name="providercontinue" value="是">
				</td>
			</tr>
			<tr>
				<td colspan="2" >
					  <a href="javascript:void(0)" class="easyui-linkbutton" onclick="contentPage.submitForm()" data-options="iconCls:'icon-add'">提交</a>
	                  <a href="javascript:void(0)" class="easyui-linkbutton" onclick="contentPage.clearForm()">重置</a>
				</td>
			</tr>
		</table>
</form>